home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / milliped.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  10KB  |  327 lines

  1. /***************************************************************************
  2.  
  3. Millipede memory map (preliminary)
  4.  
  5. driver by Ivan Mackintosh
  6.  
  7. 0400-040F       POKEY 1
  8. 0800-080F       POKEY 2
  9. 1000-13BF       SCREEN RAM (8x8 TILES, 32x30 SCREEN)
  10. 13C0-13CF       SPRITE IMAGE OFFSETS
  11. 13D0-13DF       SPRITE HORIZONTAL OFFSETS
  12. 13E0-13EF       SPRITE VERTICAL OFFSETS
  13. 13F0-13FF       SPRITE COLOR OFFSETS
  14.  
  15. 2000            BIT 1-4 trackball
  16.                 BIT 5 IS P1 FIRE
  17.                 BIT 6 IS P1 START
  18.                 BIT 7 IS VBLANK
  19.  
  20. 2001            BIT 1-4 trackball
  21.                 BIT 5 IS P2 FIRE
  22.                 BIT 6 IS P2 START
  23.                 BIT 7,8 (?)
  24.  
  25. 2010            BIT 1 IS P1 RIGHT
  26.                 BIT 2 IS P1 LEFT
  27.                 BIT 3 IS P1 DOWN
  28.                 BIT 4 IS P1 UP
  29.                 BIT 5 IS SLAM, LEFT COIN, AND UTIL COIN
  30.                 BIT 6,7 (?)
  31.                 BIT 8 IS RIGHT COIN
  32. 2030            earom read
  33. 2480-249F       COLOR RAM
  34. 2500-2502        Coin counters
  35. 2503-2504        LEDs
  36. 2505-2507        Coin door lights ??
  37. 2600            INTERRUPT ACKNOWLEDGE
  38. 2680            CLEAR WATCHDOG
  39. 2700            earom control
  40. 2780            earom write
  41. 4000-7FFF       GAME CODE
  42.  
  43. *************************************************************************/
  44.  
  45. #include "driver.h"
  46. #include "vidhrdw/generic.h"
  47. #include "machine/atari_vg.h"
  48.  
  49.  
  50. WRITE_HANDLER( milliped_paletteram_w );
  51. void milliped_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  52.  
  53. READ_HANDLER( milliped_IN0_r );
  54. READ_HANDLER( milliped_IN1_r );
  55. WRITE_HANDLER( milliped_input_select_w );
  56.  
  57. WRITE_HANDLER( milliped_led_w )
  58. {
  59.     osd_led_w (offset, ~(data >> 7));
  60. }
  61.  
  62. static struct MemoryReadAddress readmem[] =
  63. {
  64.     { 0x0000, 0x03ff, MRA_RAM },
  65.     { 0x0400, 0x040f, pokey1_r },
  66.     { 0x0800, 0x080f, pokey2_r },
  67.     { 0x1000, 0x13ff, MRA_RAM },
  68.     { 0x2000, 0x2000, milliped_IN0_r },
  69.     { 0x2001, 0x2001, milliped_IN1_r },
  70.     { 0x2010, 0x2010, input_port_2_r },
  71.     { 0x2011, 0x2011, input_port_3_r },
  72.     { 0x2030, 0x2030, atari_vg_earom_r },
  73.     { 0x4000, 0x7fff, MRA_ROM },
  74.     { 0xf000, 0xffff, MRA_ROM },        /* for the reset / interrupt vectors */
  75.     { -1 }    /* end of table */
  76. };
  77.  
  78.  
  79.  
  80. static struct MemoryWriteAddress writemem[] =
  81. {
  82.     { 0x0000, 0x03ff, MWA_RAM },
  83.     { 0x0400, 0x040f, pokey1_w },
  84.     { 0x0800, 0x080f, pokey2_w },
  85.     { 0x1000, 0x13ff, videoram_w, &videoram, &videoram_size },
  86.     { 0x13c0, 0x13ff, MWA_RAM, &spriteram },
  87.     { 0x2480, 0x249f, milliped_paletteram_w, &paletteram },
  88.     { 0x2500, 0x2502, coin_counter_w },
  89.     { 0x2503, 0x2504, milliped_led_w },
  90.     { 0x2505, 0x2505, milliped_input_select_w },
  91. //    { 0x2506, 0x2507, MWA_NOP }, /* ? */
  92.     { 0x2600, 0x2600, MWA_NOP }, /* IRQ ack */
  93.     { 0x2680, 0x2680, watchdog_reset_w },
  94.     { 0x2700, 0x2700, atari_vg_earom_ctrl_w },
  95.     { 0x2780, 0x27bf, atari_vg_earom_w },
  96.     { 0x4000, 0x73ff, MWA_ROM },
  97.     { -1 }    /* end of table */
  98. };
  99.  
  100.  
  101. INPUT_PORTS_START( milliped )
  102.     PORT_START    /* IN0 $2000 */    /* see port 6 for x trackball */
  103.     PORT_DIPNAME(0x03, 0x00, "Language" )
  104.     PORT_DIPSETTING(   0x00, "English" )
  105.     PORT_DIPSETTING(   0x01, "German" )
  106.     PORT_DIPSETTING(   0x02, "French" )
  107.     PORT_DIPSETTING(   0x03, "Spanish" )
  108.     PORT_DIPNAME(0x0c, 0x04, "Bonus" )
  109.     PORT_DIPSETTING(   0x00, "0" )
  110.     PORT_DIPSETTING(   0x04, "0 1x" )
  111.     PORT_DIPSETTING(   0x08, "0 1x 2x" )
  112.     PORT_DIPSETTING(   0x0c, "0 1x 2x 3x" )
  113.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  114.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_START1 )
  115.     PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK )
  116.     PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* trackball sign bit */
  117.  
  118.     PORT_START    /* IN1 $2001 */    /* see port 7 for y trackball */
  119.     PORT_DIPNAME(0x01, 0x00, DEF_STR( Unknown ) )
  120.     PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
  121.     PORT_DIPSETTING(   0x01, DEF_STR( On ) )
  122.     PORT_DIPNAME(0x02, 0x00, DEF_STR( Unknown ) )
  123.     PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
  124.     PORT_DIPSETTING(   0x02, DEF_STR( On ) )
  125.     PORT_DIPNAME(0x04, 0x00, "Credit Minimum" )
  126.     PORT_DIPSETTING(   0x00, "1" )
  127.     PORT_DIPSETTING(   0x04, "2" )
  128.     PORT_DIPNAME(0x08, 0x00, "Coin Counters" )
  129.     PORT_DIPSETTING(   0x00, "1" )
  130.     PORT_DIPSETTING(   0x08, "2" )
  131.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  132.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_START2 )
  133.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  134.     PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* trackball sign bit */
  135.  
  136.     PORT_START    /* IN2 $2010 */
  137.     PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  138.     PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  139.     PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  140.     PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  141.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_TILT )
  142.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
  143.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  144.     PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN3 )
  145.  
  146.     PORT_START    /* IN3 $2011 */
  147.     PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  148.     PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  149.     PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  150.     PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  151.     PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  152.     PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  153.     PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  154.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  155.  
  156.     PORT_START    /* 4 */ /* DSW1 $0408 */
  157.     PORT_DIPNAME(0x01, 0x00, "Millipede Head" )
  158.     PORT_DIPSETTING(   0x00, "Easy" )
  159.     PORT_DIPSETTING(   0x01, "Hard" )
  160.     PORT_DIPNAME(0x02, 0x00, "Beetle" )
  161.     PORT_DIPSETTING(   0x00, "Easy" )
  162.     PORT_DIPSETTING(   0x02, "Hard" )
  163.     PORT_DIPNAME(0x0c, 0x04, DEF_STR( Lives ) )
  164.     PORT_DIPSETTING(   0x00, "2" )
  165.     PORT_DIPSETTING(   0x04, "3" )
  166.     PORT_DIPSETTING(   0x08, "4" )
  167.     PORT_DIPSETTING(   0x0c, "5" )
  168.     PORT_DIPNAME(0x30, 0x10, DEF_STR( Bonus_Life ) )
  169.     PORT_DIPSETTING(   0x00, "12000" )
  170.     PORT_DIPSETTING(   0x10, "15000" )
  171.     PORT_DIPSETTING(   0x20, "20000" )
  172.     PORT_DIPSETTING(   0x30, "None" )
  173.     PORT_DIPNAME(0x40, 0x00, "Spider" )
  174.     PORT_DIPSETTING(   0x00, "Easy" )
  175.     PORT_DIPSETTING(   0x40, "Hard" )
  176.     PORT_DIPNAME(0x80, 0x00, "Starting Score Select" )
  177.     PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
  178.     PORT_DIPSETTING(   0x00, DEF_STR( On ) )
  179.  
  180.     PORT_START    /* 5 */ /* DSW2 $0808 */
  181.     PORT_DIPNAME(0x03, 0x02, DEF_STR( Coinage ) )
  182.     PORT_DIPSETTING(   0x03, DEF_STR( 2C_1C ) )
  183.     PORT_DIPSETTING(   0x02, DEF_STR( 1C_1C ) )
  184.     PORT_DIPSETTING(   0x01, DEF_STR( 1C_2C ) )
  185.     PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
  186.     PORT_DIPNAME(0x0c, 0x00, "Right Coin" )
  187.     PORT_DIPSETTING(   0x00, "*1" )
  188.     PORT_DIPSETTING(   0x04, "*4" )
  189.     PORT_DIPSETTING(   0x08, "*5" )
  190.     PORT_DIPSETTING(   0x0c, "*6" )
  191.     PORT_DIPNAME(0x10, 0x00, "Left Coin" )
  192.     PORT_DIPSETTING(   0x00, "*1" )
  193.     PORT_DIPSETTING(   0x10, "*2" )
  194.     PORT_DIPNAME(0xe0, 0x00, "Bonus Coins" )
  195.     PORT_DIPSETTING(   0x00, "None" )
  196.     PORT_DIPSETTING(   0x20, "3 credits/2 coins" )
  197.     PORT_DIPSETTING(   0x40, "5 credits/4 coins" )
  198.     PORT_DIPSETTING(   0x60, "6 credits/4 coins" )
  199.     PORT_DIPSETTING(   0x80, "6 credits/5 coins" )
  200.     PORT_DIPSETTING(   0xa0, "4 credits/3 coins" )
  201.     PORT_DIPSETTING(   0xc0, "Demo mode" )
  202.  
  203.     PORT_START    /* IN6: FAKE - used for trackball-x at $2000 */
  204.     PORT_ANALOGX( 0xff, 0x00, IPT_TRACKBALL_X | IPF_REVERSE, 50, 10, 0, 0, IP_KEY_NONE, IP_KEY_NONE, IP_JOY_NONE, IP_JOY_NONE )
  205.  
  206.     PORT_START    /* IN7: FAKE - used for trackball-y at $2001 */
  207.     PORT_ANALOGX( 0xff, 0x00, IPT_TRACKBALL_Y, 50, 10, 0, 0, IP_KEY_NONE, IP_KEY_NONE, IP_JOY_NONE, IP_JOY_NONE )
  208. INPUT_PORTS_END
  209.  
  210.  
  211. static struct GfxLayout charlayout =
  212. {
  213.     8,8,    /* 8*8 characters */
  214.     256,    /* 256 characters */
  215.     2,    /* 2 bits per pixel */
  216.     { 0, 256*8*8 },    /* the two bitplanes are separated */
  217.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  218.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  219.     8*8    /* every char takes 8 consecutive bytes */
  220. };
  221. static struct GfxLayout spritelayout =
  222. {
  223.     8,16,    /* 16*8 sprites */
  224.     128,    /* 64 sprites */
  225.     2,    /* 2 bits per pixel */
  226.     { 0, 128*16*8 },    /* the two bitplanes are separated */
  227.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  228.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  229.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  230.     16*8    /* every sprite takes 16 consecutive bytes */
  231. };
  232.  
  233.  
  234.  
  235. static struct GfxDecodeInfo gfxdecodeinfo[] =
  236. {
  237.     { REGION_GFX1, 0, &charlayout,      0, 4 },    /* use colors 0-15 */
  238.     { REGION_GFX1, 0, &spritelayout,   16, 1 },    /* use colors 16-19 */
  239.     { -1 } /* end of array */
  240. };
  241.  
  242.  
  243.  
  244. static struct POKEYinterface pokey_interface =
  245. {
  246.     2,    /* 2 chips */
  247.     1500000,    /* 1.5 MHz??? */
  248.     { 50, 50 },
  249.     /* The 8 pot handlers */
  250.     { 0, 0 },
  251.     { 0, 0 },
  252.     { 0, 0 },
  253.     { 0, 0 },
  254.     { 0, 0 },
  255.     { 0, 0 },
  256.     { 0, 0 },
  257.     { 0, 0 },
  258.     /* The allpot handler */
  259.     { input_port_4_r, input_port_5_r },
  260. };
  261.  
  262.  
  263.  
  264. static struct MachineDriver machine_driver_milliped =
  265. {
  266.     /* basic machine hardware */
  267.     {
  268.         {
  269.             CPU_M6502,
  270.             1500000,    /* 1.5 Mhz ???? */
  271.             readmem,writemem,0,0,
  272.             interrupt,4
  273.         }
  274.     },
  275.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  276.     10,
  277.     0,
  278.  
  279.     /* video hardware */
  280.     32*8, 32*8, { 0*8, 32*8-1, 0*8, 30*8-1 },
  281.     gfxdecodeinfo,
  282.     32, 32,
  283.     0,
  284.  
  285.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY|VIDEO_MODIFIES_PALETTE,
  286.     0,
  287.     generic_vh_start,
  288.     generic_vh_stop,
  289.     milliped_vh_screenrefresh,
  290.  
  291.     /* sound hardware */
  292.     0,0,0,0,
  293.     {
  294.         {
  295.             SOUND_POKEY,
  296.             &pokey_interface
  297.         }
  298.     },
  299.  
  300.     atari_vg_earom_handler
  301. };
  302.  
  303.  
  304.  
  305. /***************************************************************************
  306.  
  307.   Game driver(s)
  308.  
  309. ***************************************************************************/
  310.  
  311. ROM_START( milliped )
  312.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  313.     ROM_LOAD( "milliped.104", 0x4000, 0x1000, 0x40711675 )
  314.     ROM_LOAD( "milliped.103", 0x5000, 0x1000, 0xfb01baf2 )
  315.     ROM_LOAD( "milliped.102", 0x6000, 0x1000, 0x62e137e0 )
  316.     ROM_LOAD( "milliped.101", 0x7000, 0x1000, 0x46752c7d )
  317.     ROM_RELOAD(               0xf000, 0x1000 )    /* for the reset and interrupt vectors */
  318.  
  319.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  320.     ROM_LOAD( "milliped.106", 0x0000, 0x0800, 0xf4468045 )
  321.     ROM_LOAD( "milliped.107", 0x0800, 0x0800, 0x68c3437a )
  322. ROM_END
  323.  
  324.  
  325.  
  326. GAME( 1982, milliped, 0, milliped, milliped, 0, ROT270, "Atari", "Millipede" )
  327.